let baseUrl = "http://192.168.43.18:2345"

let request = ({ url, data, method }) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: baseUrl + url,
      data,
      method,
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success(res) {
        resolve(res.data)
      }
    })
  })
}

module.exports = request